#include <cstdio>
#include <cstring>
#include <vector>
using std::vector;
#define maxn 270
vector<int> G[maxn];
int dp[maxn];
int son[maxn];
int n;
int total[maxn];
int root;

void init()
{
    int num = 1 << n;
    for (int i = 1; i <= num; i++)
    {
        G[i].clear();
    }
    memset(dp, 0, sizeof(dp));
    memset(son, 0, sizeof(son));
}

bool read()
{
    scanf("%d", &n);
    if (n == 0)
        return 0;
    int num = 1;
    num = 1 << n;
    num = num - 1;
    init();
    for (int i = 1; i <= num; i++)
    {
        scanf("%d", &total[i]);
    }
    root = total[num];
    for (int i = num - 1; i >= 1; i = i - 2)
    {
        G[total[i]].push_back(total[i - 1]);
        G[total[i - 1]].push_back(total[i]);
    }
    for (int i = 1; i <= (num + 1) >> 1; i++)
    {
        if (total[i] % 2)
        {
            G[total[i]].push_back(total[i] + 1);
            G[total[i] + 1].push_back(total[i]);
        }
        else
        {
            G[total[i]].push_back(total[i] - 1);
            G[total[i] - 1].push_back(total[i]);
        }
    }
    return n;
}
void debug()
{
    int num = 1;
    int i = n;
    num = 1 << n;
    for (int i = 1; i <= num; i++)
    {
        printf("%d : ", i);
        for (int j = 0; j != G[i].size(); j++)
        {
            printf(" %d ", G[i][j]);
        }
        printf("\n");
    }
}

void dfs(int v, int f)
{
    dp[v] = dp[f] + 1;
    for (int i = 0; i != G[v].size(); i++)
    {
        int u = G[v][i];
        if (u == f)
            continue;
        dfs(u, v);
        son[v] += son[u] + 1;
    }
}

void solve()
{
    dp[0] = 0;
    dfs(root, 0);

    int Q;
    int x;
    scanf("%d", &Q);
    for (; Q--;)
    {
        scanf("%d", &x);
        printf("Player %d can be ranked as high as %d or as low as %d.\n", x, dp[x], (1 << n) - son[x]);
    }
    printf("\n");
}
int main()
{
    while (read())
    {
        // debug() ;
        solve();
    }
    return 0;
}